package com.ailesson.video.api;

import com.ailesson.common.reply.R;
import com.ailesson.video.service.VideoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Tag(name = "小结视频api")
@RestController
@RequestMapping("/api/video/vod")
public class VideoApiController {

    @Autowired
    private VideoService videoService;

    @Operation(summary = "点播视频播放接口")
    @GetMapping("/getPlayAuth/{courseId}/{videoId}")
    public R getPlayAuth(
            @PathVariable Long courseId,
            @PathVariable Long videoId) {
        Map<String,Object> map = videoService.getPlayAuth(courseId,videoId);
        return R.success(map);
    }
}
